import { stringify } from 'qs';
import request from '@/utils/request';

// 获取订单列表
export async function GetList(params) {
    return request(`/${window.storeId}/RightsOrder/GetList?${stringify(params)}`);
}

// 通过维权Id获取订单详情
export async function GetDetail(params) {
    return request(`/${window.storeId}/RightsOrder/GetDetail?${stringify(params)}`);
}

// 获取退款协商记录
export async function GetLog(params) {
    return request(`/${window.storeId}/RightsOrder/GetLog?${stringify(params)}`);
}

 // 同意退款申请(仅退款)
 export async function AgreeRefund(params) {
    return request(`/${window.storeId}/RightsOrder/AgreeRefund`, {
      method: 'POST',
      body: {
        ...params
     }
    });
  }

  // 线下仅退款
  export async function AgreeOffRefund(params) {
    return request(`/${window.storeId}/RightsOrder/AgreeOffRefund`, {
      method: 'POST',
      body: {
        ...params
     }
    });
  }

  // 拒绝
  export async function RefuseRefund(params) {
    return request(`/${window.storeId}/RightsOrder/RefuseRefund`, {
      method: 'POST',
      body: {
        ...params
        }
    });
  }

  // 同意退货，发送退货地址
  export async function AgreeReturnGoods(params) {
    return request(`/${window.storeId}/RightsOrder/AgreeReturnGoods`, {
      method: 'POST',
      body: {
        ...params
     }
    });
  }

  // 同意退货，发送退货地址（新增收货地址）
  export async function AgreeReturnAddr(params) {
    return request(`/${window.storeId}/RightsOrder/AgreeReturnAddr`, {
      method: 'POST',
      body: {
        ...params
     }
    });
  }

  // 确认收到退货
  export async function ComfirmReturn(params) {
    return request(`/${window.storeId}/RightsOrder/ComfirmReturn`, {
      method: 'POST',
      body: {
        ...params
     }
    });
  }

    // 线下确认收到退货
    export async function ComfirmOffReturn(params) {
        return request(`/${window.storeId}/RightsOrder/ComfirmOffReturn`, {
          method: 'POST',
          body: {
            ...params
         }
        });
      }

  //拒绝退货申请
  export async function RefuseReturn(params) {
    return request(`/${window.storeId}/RightsOrder/RefuseReturn`, {
      method: 'POST',
      body: {
        ...params
     }
    });
  }

    //订单导出
    export async function ExportList(params) {
        return request(`/${window.storeId}/RightsOrder/ExportList`, {
          method: 'POST',
          body: {
            ...params
         }
        });
      }




